package com.example.api.controller;

import com.example.api.aspect.SystemControllerLog;
import com.example.api.model.entity.LoginLog;
import com.example.api.model.enums.ActionTypeEnum;
import com.example.api.service.LoginLogService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import java.util.List;

@Api(tags = "日志管理")
@RestController
@RequestMapping("/api/log")
public class LoginLogController {

    @Resource
    private LoginLogService loginLogService;
    
    @ApiOperation("查询登录日志")
    @GetMapping("/")
    @SystemControllerLog(description = "查询登录日志", actionType = ActionTypeEnum.QUERY)
    public List<LoginLog> findAll(String name) {
        return loginLogService.findAll(name);
    }

}